<juci-layout-with-sidebar>
	<div ng-controller="icwmpProvisioningPage">
		<h2 translate>IUP Provisioning</h2>
		<p translate>Setup your IUP Provisioning parameterrs</p>
		<juci-config-section>
			<h3 translate>General</h3>
			<juci-config-lines>
				<juci-config-line title="{{ 'Enabled' | translate }}">
					<switch class="green" ng-model="general.enabled.value" />	
				</juci-config-line>
				<juci-config-line title="{{ 'Update interval start time' | translate }}">
					<juci-select ng-items="times" ng-model="general.starttime.value"></juci-select>
				</juci-config-line>
				<juci-config-line title="{{ 'Update interval' | translate }}">
					<juci-select ng-items="update_interval" ng-model="general.interval.value"></juci-select>
				</juci-config-line>
				<juci-config-line title="{{ 'Export file' | translate }}">
					<button class="btn btn-default" ng-click="onExportFile()" translate>Export file</button>
				</juci-config-line>
			</juci-config-lines>
			<h3 translate>Main Provisioning Server</h3>
			<juci-config-lines>
				<juci-config-line title="{{ 'Enabled' | translate }}" help="{{ 'If added will override DHCP Discover Provisioning' | translate }}">
					<switch class="green" ng-model="prov_server.enabled.value" />
				</juci-config-line>
				<juci-config-line ng-show="prov_server.enabled.value" title="{{ 'Reboot' | translate }}" help="{{ 'Reboot after settings config 
									usualy needed for network settings to work properly' | translate }}">
					<switch class="green" ng-model="prov_server.reboot.value" />
				</juci-config-line>
				<juci-config-line ng-show="prov_server.enabled.value" title="{{ 'URL' | translate }}">
					<input type="text" class="form-control" ng-model="prov_server.url.value" />
				</juci-config-line>
				<juci-config-line ng-show="prov_server.enabled.value" title="{{ 'Decryption Key' | translate }}" 
							help="{{ 'If not entered, Default onboard DES Key will be used insted' | translate }}">
					<div class="input-group">
						<input type="{{ showPasswd ? 'text' : 'password' }}" class="form-control" ng-model="prov_server.deckey.value">
						<span class="input-group-addon" ng-click="togglepw()" style="cursor:pointer">
							<i class="{{ showPasswd ? 'fa fa-lock' : 'fa fa-unlock' }}"></i>
						</span>
					</div>
				</juci-config-line>
			</juci-config-lines>
			<h3 translate>DHCP Discover Provisioning Server</h3>
			<juci-config-lines>
				<juci-config-line title="{{ 'Enabled' | translate }}">
					<switch class="green" ng-model="dhcp_server.enabled.value" />
				</juci-config-line>
			<juci-config-lines>
			<h3 translate>Software Update Config</h3>
			<juci-config-lines>
				<juci-config-line title="{{ 'Enabled' | translate }}">
					<switch class="green" ng-model="uppgrade_server.enabled.value" />
				</juci-config-line>
				<juci-config-line title="{{ 'Defaultreset' | translate }}" help="{{ 'Will remove any configuration set on the device and 
								set it to software default' | translate }}">
					<switch class="green" ng-model="uppgrade_server.defaultreset.value" />
				</juci-config-line>
				<juci-config-line title="{{ 'Software URL' | translate }}">
					<input type="text" class="form-control" ng-model="uppgrade_server.url.value">
				</juci-config-line>
			</juci-config-lines>
		</juci-config-section>
		<juci-config-section>
		<h3 translate>Sub Configs</h3>
		<table class="table table-hover">
			<thead>
				<tr>
					<th translate>URL</th>
					<th translate>Package Control</th>
					<th translate>Enabled</th><th></th>
				</tr>
			</thead>
			<tbody>
				<tr ng-repeat="conf in subconfigs">
					<td><input type="text" class="form-control" ng-model="conf.url.value"></td>
					<td><input type="text" class="form-control" ng-model="conf.packagecontrol.value"></td>
					<td><switch class="green" ng-model="conf.enabled.value" /></td>
					<td><button class="btn btn-default" ng-click="onDeleteConf(conf)" translate>Delete</button></td>
				</tr>
			</tbody>
		</table>
		<button class="btn btn-default" ng-click="onAddConf()" translate>Add sub config</button>
		</juci-config-section>
		<juci-config-apply></juci-config-apply>
	</div>
</juci-layout-with-sidebar>
